{% extends "main.html" %}
{% block content %}

{% if hsh %}
  Client created. Use the hash {{hsh}} for your client {{name}} to
  authenticate.
<br /><br />
{% endif %}

{% if del_hsh %}
  Client with hash {{del_hsh}} deleted
<br /><br />
{% endif %}

<table class="contentTable">
	<tr>
		<td class="left">

			<h3>Add Client</h3>

			  <form action="#" method="post">
				<div class="field">
				    <label>Client name:</label>
					<input type="textfield" name="client_name" />
				</div>
				<div class="field">
				    <label>Client password:</label>
					<input type="textfield" name="client_pw" />
				</div>
			    <input class="submit" type="submit" />
			  </form>


			<h3>Invite xmpp User</h3>

			  <form action="/xmppinvite" method="GET">
				<div class="field">
				    <label>JID (Jabber ID):</label>
					<input type="textfield" name="jid" />
				</div>
			    <input class="submit" type="submit" />
			  </form>
			</td>

			<td>

				<h3>Clients</h3>

				<table class="listing">
				  <thead>
				    <th>name</th>
				    <th>key</th>
				  </thead>
				  {% for client in clients %}
				  <tr>
				    <td class="first">{{client.name}}</td>
				    <td>{{client.auth_key}}</td>
				    <td class="del"><a href="/clients?deletehsh={{client.auth_key}}">delete</a></td>
				  </tr>
				 {% endfor %}
				</table>
			</td>
		</tr>
	</table>

{% endblock %}